package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysStudent;
import com.ruoyi.system.mapper.SysStudentMapper;
import com.ruoyi.system.service.ISysStudentService;
import org.springframework.stereotype.Service;

/**
 * 学生信息Service业务层处理
 *
 * @author wlq
 */
@Service
public class SysStudentServiceImpl extends ServiceImpl<SysStudentMapper, SysStudent> implements ISysStudentService
{
    @Override
    public TableDataInfo<SysStudent> selectPageList(SysStudent sysStudent, PageQuery pageQuery) {
        LambdaQueryWrapper<SysStudent> lqw = new LambdaQueryWrapper<SysStudent>()
                .like(StringUtils.isNotBlank(sysStudent.getStudentName()), SysStudent::getStudentName, sysStudent.getStudentName())
                .eq(StringUtils.isNotBlank(sysStudent.getStudentSex()), SysStudent::getStudentSex, sysStudent.getStudentSex())
                .eq(StringUtils.isNotBlank(sysStudent.getStudentStatus()), SysStudent::getStudentStatus, sysStudent.getStudentStatus());
        Page<SysStudent> page = baseMapper.selectPage(pageQuery.build(), lqw);
        return TableDataInfo.build(page);
    }
}
